<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <title>Title</title>
</head>
<body>


<script>
    function friend(name, age, sex, friend, speck, say) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.friend = friend;
        this.speck = speck;
        this.say = say;
        return this.name + "今年" + this.age + "岁," + "性别:" + this.sex + this.friend + this.speck + this.say
    }
    var mingming = friend("小明", "18", "男", "有男朋友", "男朋友会说话", "说他们是相爱的");
    alert(mingming)

    function car(name, times, hg, num, sm) {
        var cars = new Object();
        cars.name = name;
        cars.times = times;
        cars.hg = hg;
        cars.num = num;
        cars.sm = sm;
        cars.say = function () {
            alert(cars.name + "出厂时间：" + cars.times + "合格证" + cars.hg + "建议零售价格：" + cars.num + "说明书" + cars.sm)
        }
        return cars;
    }
    var qq = car("QQ", "2010.01.01", "合格品", "100,00", "这是一辆车")
    qq.say();

</script>
</body>
</html>